#define _GNU_SOURCE
#include "app_mqtt.h"
#include "log/log.h"
#include <unistd.h>

int recv_callback(char *data, int len)
{
    log_warn("处理接受到的消息tid=%d，消息内容：%s,长度：%d", gettid(), data, len);
    return 0;
}
int main()
{
    log_debug("main线程执行tid=%d",gettid());
    app_mqtt_init();

    app_mqtt_registRecvCallback(recv_callback);
    app_mqtt_send("hello world", 11);
    sleep(30);

    log_debug("main线程退出tid=%d",gettid());
    return 0;
}